/*
 * Created on2022-10-10 9:31
 *
 * Copyright(c) YuZhou Big Data Laboratory CO.,Ltd, 2021. All rights reserved
 */

package org.yzbdl.lanius.core.plugins.metastore;

import lombok.Getter;

/**
 * 插件类别释义枚举
 *
 * @author hl
 * @version 1.0
 * @date 2020-10-10 9:31
 */
@Getter
public enum CategoryI18n {

    StepPluginType("org.pentaho.di.core.plugins.StepPluginType", "转换"),
    JobEntryPluginType("org.pentaho.di.core.plugins.JobEntryPluginType", "作业"),
    DatabasePluginType("org.pentaho.di.core.plugins.DatabasePluginType", "数据库"),

    CompressionPluginType("org.pentaho.di.core.compress.CompressionPluginType", "压缩插件"),
    RepositoryPluginType("org.pentaho.di.core.plugins.RepositoryPluginType", "资源库插件"),
    CartePluginType("org.pentaho.di.core.plugins.CartePluginType", "Carte插件"),

    // TransDialogPlugin("", "转换对话框插件"),
    // JobDialogPlugin("", "作业对话框插件"),
    //
    // CarteServlet("", "Carte服务"),
    // SpoonPlugin("", "SpoonUI插件"),
    // LoggingPlugin("", "日志插件"),
    // LogTablePlugin("", "日志表插件"),
    // RepositoryPlugin("", "资源库插件"),

    DEFAULT("default", "无法识别");

    private String name;

    private String i18n;

    CategoryI18n(String name, String i18n) {
        this.name = name;
        this.i18n = i18n;
    }

    public static CategoryI18n fromStringOrNull(String name) {
        try {
            return CategoryI18n.valueOf(name);
        } catch (IllegalArgumentException e) {
            return DEFAULT;
        }
    }

}
